package com.example.carefree_server.mapper.m_studentMapper;

import com.example.carefree_server.entity.Activity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface ActivityMapper {

    //   查询所有
    @Select("SELECT aname, did, sid, sname,type, types FROM activity")
    List<Activity> findAllActivity();

    //    一键查询
    @Select("SELECT aname, did, sid, sname,type, types FROM activity WHERE sid = #{sid}")
    List<Activity> findActivityById(String sid);

//分类查询 主类型
    @Select("select aname, did, sid, sname, type, types from activity where sid = #{sid} and  type = #{type}")
    List<Activity> findActivitiesByType( String sid,  String type);

//    分类查询 副类型
    @Select("select aname, did, sid, sname, type, types from activity where sid = #{sid} and  type = #{type} and types = #{types}")
    List<Activity> findActivitiesByTypes( String sid,  String type ,  String types);
}
